package com.controller;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117659029";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCxNJEwRfOzpwx2Z82PEygPOm8pn6Epiv3XrlxXyYBF1UjXzfv+QCd9SPYNPa/xTYgkIk8SeZMmW5/uP+9v48VVD+4y06wDuvndcdXCGF31zL61rWJ5xG4U4YdzRhgiY7Qmjj4zbUoobOvgfvNnyVbi6hfGmMmaINvKrwZ3JMzaPvsaIc12Dmwtqpcvb+gSy2rN2uKM48f9HZJAVCnxlc8kauFfl71EJLoSE5nbz5dTXXRQbw40crQAu81Zga/i/Q+cOWmkjNWKUUtZWLi8n5K+aMlLLxWa8/Z52I8Rc3mjSNotlX8qNv2iDciAPH1al/u88Vqag5yEAFtWFXyV+TG3AgMBAAECggEALI66PzgnqjHD6XX6cxJvDT01PHMeFBMV9wipwY0yStzxfwoVZf39r/wLmpK7TeKf6+4QkeWuAYQid8btzuWn9daWn4MoCpwWPf9kr3RvE+JSxd3+F/4za961r1+dq/AEGXnE3CuL7RROT1m8nIk85rvUFKTQdIf0nEdcSdMgC3RE+TKa34BYmBtwLekzoMSvz/mzxIse2QXWxtiZXgRBdMUZD3M2AtWHJHssWLbNzbS4ggbtlajwP+Eggz8eQF6wFqYK8h+KG5bsXXL9dNcdcgmI5/4CF688HWibIC8RSDKWdC28xBfuMMGX64SdmjPjeEFl63YK4aFa3b1X774peQKBgQDs6aPh9Qk6QtAjwxva0BVFCCVdUlRr01U17tJ0ryJDceQCyerRZ886NzVW4N09YL/F55a2SWceI7wsxCurnPAprMhoBvvrpLngkDPJVeZif5hFhPHfY02yaOHXYzI8a3hp+cI79XiSe/eHFvsj98wY6vVPPuBO2jlzaw/aelcO2wKBgQC/e3RVc1SjnEb1NkbC1U9IJAtuuvkxgIjXaA67E1r2TDCPYQ3x/wvRUehMxN4GDRxBq0QBqLvseSpPp/fWFKpyPdQgG6PU5EFG1QXh33umcr+BP+D+wzHRuB+0s4SnSU79vqhrBlCNGPKfmQBVaWwWVPItTc/5+0zy9kAgk4+5VQKBgQCloSp7/I2496EAf5VnwvY7ztggiECRKax3CkKEZTR1JpicAoJyaDsOni5iUM8b7BnmyGQriOHYxm72dSd60TtuR2fMoqVZN07kWqx5494vmrjgUXOwE4LsajsKFEW4zAHhRUWwGYt0Dcsd3Mkzejhsa0eZYYH8XsCvmnf47HMU5QKBgBuehggxS3sR9pY2DvzZYccpE9ET/Q+r15EifEV1pEA0eyijOiy2uhCmPNid6Nx8lZ/PQU7v9LNGQtkchD4H2xIBYxCCjB4QEm5SGbgb0S0QDhlpil2U8CGs6j3ZSwAKLe+hyY8uaP4BJDXrDsZDH4kVFZ19RMts+Qtug49vWWLFAoGAHBqKczwdqcYzM+wz8F+R5TSA5+JUOOINjVbKywlkIBao5CZ0cybsQVVtjH7bqZuwJgBCCIWXdfPdVk/ORjSjpZqk3aEY4xhnxOSjLRBHUNSb0OwM+uDkGvV+33Kaokeyif0NPZJRn16wB7RZqzn/zleB8weTwF7vCvDO/On1tFs=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyOWB+8+L1mYj2A+rBkvbG7m8RhBCzyxb+J9jT9AInA/3YaIZXwWK2chqNXSnUN2LAVLAh9by+Lah6x+d8NnaesPbP4zFnzTGN8aZ9gFY4AyIyNYv9g6got8CnZb0VO40TbCu+qPKQF8KnBl+i1vIs7oKmFwYZh6cQ2XWnJyPE1AEBgLBMtvk3JdE0tsDo71m0GomOtV2AtFcXeYXwtN5uA0eYqoIQC+OJXaS3ergjDKSy6qNoxnCf3/S+h0Jat/xGkfQtpCZiDnLjab9r7IPperE3WIWdk7r/sFmA8gaoE4exbZd+JvhVh6Rr4rCCbjskt1PqLZHUsTaMtAhA0NzCwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8888/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8888/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
